class Student extends User{
    static constraints = {
    }

   static mapping = {
       table 'jiajiao_student'
    }

    String toString() {
        "${realname}"
    }

        String toStr() {
"""${username}
${realname}
${sex}
${personId }
${birthday}
${area}
${tel}
${mobile}
${qq}
${email}
${address}
${post}
${introduction }"""
   }
    static namedQueries = { 
        random { max ->
            if (!max) {
                max = 1
            }
            def now = new Date() 
            println max
            lt 'createTime', now - (int)(Math.random()*100+1)
            maxResults(max)
            order("createTime", "asc")
        }
    }
}
